home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
games
/
65
/
pascal
/
dfree.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-10-16
|
1KB
|
47 lines
Program test;
TYPE
FreeRec = Packed RECORD
FreeCl : Long_Integer; { # of free clusters }
NumCl : Long_Integer; { total # of clusters on disk }
SecSiz : Long_Integer; { Sector size in bytes }
CluSiz : Long_Integer; { number of sectors per cluster }
END;
FreePtr = ^FreeRec; { pointer to free record }
VAR
space : Long_Integer;
Procedure Dfree( VAR rec : FreeRec; drive : Integer ) ;
GEMDOS( $36 );
Function Free( drive : integer ) : Long_integer;
{ drive 1-16 for A - P, 0 for current}
VAR
FreeInf : FreeRec; { what dfree returns }
BEGIN
Dfree( FreeInf, 1 ); { get info into freeinf }
WITH FreeInf DO
BEGIN
Free := FreeCL * ( SecSiz * CluSiz );
END;
END;
begin
space := Free( 1 ); { get free space on drive A }
writeln( 'Free space = ', space );
end.